package com.wanpinghui.supplier.widgets;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.wanpinghui.supplier.R;

/**
 * Created by tg596 on 2018/1/23.
 */

public class CompanyInfoHeaderView extends RelativeLayout {

    private String title;//标题(文字)
    private TextView tv_content;
    private View v_line;
    private View v_cricle;

    public CompanyInfoHeaderView(Context context) {
        super(context);
        init(context);
    }



    public CompanyInfoHeaderView(Context context, AttributeSet attrs) {
        super(context, attrs);
        TypedArray mTypedArray = getResources().obtainAttributes(attrs,
                R.styleable.CompanyInfoHeaderView);
        title = mTypedArray.getString(R.styleable.CompanyInfoHeaderView_content);
        init(context);
        mTypedArray.recycle();
    }


    private void init(Context context) {
        View view  = LayoutInflater.from(context).inflate(R.layout.view_company_info_header,this);
         tv_content = (TextView)view.findViewById(R.id.tv_content);
         v_line = view.findViewById(R.id.v_line);
         v_cricle = view.findViewById(R.id.view_cricle);
        tv_content.setText(title);
    }

    public void setSelcet(boolean b){
        v_cricle.setSelected(b);
        v_line.setSelected(b);
        tv_content.setSelected(b);
    }



}
